<?php
class Entite{
	private $id;
	private $TypeEntite;
	private $proprietes;
	function __construct($id) {

		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	public function getId(){
		return $this->id;
	}
	public function getTypeEntite(){
		return $this->TypeEntite;
	}
	public function setTypeEntite($TypeEntite){
		if(is_a($TypeEntite, "TypeEntite")){
			$this->TypeEntite = $TypeEntite;
		}else{
			throw new FieldFormatException($_SESSION['translator']->reqInstance." TypeEntite");
		}

	}
	public function getPropriete(){
		return $this->proprietes;
	}
	public function setProprietes($propTab){
		if(is_array($propTab)){
			$bool = true;
			foreach ($propTab as $prop){
				if(!is_a($prop, "Propriete")){
					$bool = false;
				}
			}
			if($bool){
				$this->proprietes = $propTab;
			}else{
				throw new FieldFormatException($_SESSION['translator']->listEx." Propriete");
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->arrayErr);
		}
	}
}